package com.example.customview.bezier

import android.annotation.SuppressLint
import com.alibaba.android.arouter.facade.annotation.Route
import com.android.baselibrary.base.BaseDBFragment
import com.android.baselibrary.base.bindAdapter
import com.android.baselibrary.recycler.linear
import com.example.customview.R
import com.example.customview.arouter.CustomArouter
import com.example.customview.bean.BezierViewModel
import com.example.customview.databinding.FragmentBezierMainBinding

/**
 * 贝塞尔曲线主页
 */
@Route(path = CustomArouter.CUSTOM_BEZIER_MAIN_FRAGMENT)
class BezierMainFragment:BaseDBFragment<FragmentBezierMainBinding>(R.layout.fragment_bezier_main) {
    @SuppressLint("UseCompatLoadingForDrawables")
    override fun initView() {
        activity?.run {
            actionBar?.run {
                title = "贝塞尔曲线主页"
            }
        }
        mBinding.rlBezier.linear().bindAdapter<BezierViewModel> {
          addLayout(BezierMainView(requireContext()))
        }.setData(list)

    }

    private val list by lazy {
        mutableListOf(
          //  BezierViewModel("水平面",CustomArouter.CUSTOM_BEZIER_WATER_FRAGMENT),
           // BezierViewModel("二阶贝塞尔曲线",CustomArouter.CUSTOM_BEZIER_SECOND_FRAGMENT),
            BezierViewModel("拖拽小圆点",CustomArouter.CUSTOM_BEZIER_RED_DOT_FRAGMENT),
        )
    }
}